<template>
	<view class="headr" :style="{'background': background,'color': color}">
		 <!-- showBack -->
		 
		<view><u-icon class="back-btn" name="arrow-left" @click="gotoPage"  v-show="showBack"></u-icon></view>
		<text>{{title}}</text>
		<text></text>
		<!-- not -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
			}
		},
		props: {
			title: {
				default: '上门服务',
			},
			background: {
				default: '#2979FF',
			},
			color: {
				default: '#fff',
			},
			showBack: {
				default: false,
			},
			backFn: {
				default: ''
			}
		},
		onLoad() {

		},
		methods: {
			gotoPage() {
				if (this.backFn) {
					this.backFn()
				} else {
					uni.navigateBack({
					    delta: 1
					});
				}
			}
		}
	}
</script>

<style>
	.headr {
		display: flex;
		/* flex-direction: column; */
		align-items: center;
		justify-content: space-between;
		height: 90rpx;
		line-height: 90rpx;
		color: #FFFFFF;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		opacity: 1;
		z-index: 9999;
		padding: 0 20rpx;
		box-sizing: border-box;
	}
</style>
